<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="企业名称"  
 prop="a1"  >
                        <p>{{dataForm.a1}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="单位类型"  
 prop="a3"  >
                        <p>{{dataForm.a3}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="产品/服务名称"  
 prop="pa1"  >
                        <p>{{dataForm.pa1}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="产品大类"  
 prop="productcategory"  >
                        <p>{{dataForm.productcategory}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="产品小类"  
 prop="pa3"  >
                        <p>{{dataForm.pa3}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="营业收入得分（2分）"  
 prop="l1s"  >
                        <p>{{dataForm.l1s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="员工规模得分（1分）"  
 prop="l2s"  >
                        <p>{{dataForm.l2s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="人效比得分（2分）"  
 prop="l3s"  >
                        <p>{{dataForm.l3s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="研发投入比例得分（2分）"  
 prop="l4s"  >
                        <p>{{dataForm.l4s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="研发人员比例得分（2分）"  
 prop="l5s"  >
                        <p>{{dataForm.l5s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="标准编制得分（3分）"  
 prop="l6s"  >
                        <p>{{dataForm.l6s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="知识产权数量得分（2分）"  
 prop="l7s"  >
                        <p>{{dataForm.l7s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="服务中小企业数量得分（3分）"  
 prop="l8s"  >
                        <p>{{dataForm.l8s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="服务专精特新企业占服务中小企业数量比例得分（2分）"  
 prop="l9s"  >
                        <p>{{dataForm.l9s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="产品实施周期得分（5分）"  
 prop="l10s"  >
                        <p>{{dataForm.l10s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="同类型产品价格水平得分（5分）"  
 prop="l11s"  >
                        <p>{{dataForm.l11s}}</p>
                </jnpf-form-tip-item>
            </el-col>
            <el-col :span="24"  >
                <jnpf-form-tip-item  label="贯标服务能力得分（3分）"  
 prop="l12s"  >
                        <p>{{dataForm.l12s}}</p>
                </jnpf-form-tip-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    <Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'

    import { getConfigData } from '@/api/onlineDev/visualDev'
    import jnpf from '@/utils/jnpf'
    import Detail from '@/views/basic/dynamicModel/list/detail'
    import { thousandsFormat } from "@/components/Generator/utils/index"
    export default {
        components: { Detail},
        props: [],
        data() {
            return {
                visible: false,
                detailVisible: false,
                loading: false,

            dataForm: {
                id :'',
                            a1 : '',
                            a3 : '',
                            pa1 : '',
                            productcategory : '',
                            pa3 : '',
                            l1s : '',
                            l2s : '',
                            l3s : '',
                            l4s : '',
                            l5s : '',
                            l6s : '',
                            l7s : '',
                            l8s : '',
                            l9s : '',
                            l10s : '',
                            l11s : '',
                            l12s : '',
            },

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            toDetail(defaultValue, modelId) {
                if (!defaultValue) return
                getConfigData(modelId).then(res => {
                    if (!res.data || !res.data.formData) return
                    let formData = JSON.parse(res.data.formData)
                    formData.popupType = 'general'
                    this.detailVisible = true
                    this.$nextTick(() => {
                        this.$refs.Detail.init(formData, modelId, defaultValue)
                    })
                })
            },
            dataInfo(dataAll){
                let _dataAll =dataAll
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/Ps_dingliang/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
